import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/4 11:25
 * @description:
 */
public class FiletooArraylist {

  public static void main(String[] args) throws IOException {


    BufferedReader br=new BufferedReader(new FileReader("list.txt"));
    ArrayList<String>arrayList=new ArrayList<String>();
    String line=null;

    while ( (line=br.readLine())!=null) {
    arrayList.add(line);
    }
    br.close();


    Iterator iterator=arrayList.iterator();
    while (iterator.hasNext()){
      System.out.println(iterator.next());
    }
  }
}